import tensorflow as tf

# ==== 计算 1+2+3...+10 ====
value = tf.Variable(0, name='value')
result = tf.Variable(0, name='result')

for _ in range(10):
    value.assign_add(1)
    result.assign(result + value)

print(result)
